<%@ page language="java" import="java.util.*"
	import="com.sellerSystem.vo.*" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>欢迎！</title>
</head>

<style type="text/css">
#p {
	width: 100px;
	height: 100px
}
#welcome{
text-align: right;
}
#a {
	border-color: #FFF;
}
#table{
	text-align: center;
	width: 100%;
	font-size: 25px;
}
#index {
	text-align: right;
}
</style>


<script src="js/jquery-1.12.0.min.js" type=text/javascript></script>


</head>

<body onResize="Resize()">
	<p id="welcome"><i>欢迎<b>${seller.sellerName}</b>来到您的个人商铺！</i></p>
	<p id="index"><a href="loginSuc.jsp">首页</a>&nbsp;&nbsp;<a href="index.html">退出系统</a>&nbsp;</p>

		
	<table id="table"></table>
</body>
<script>
	var thisURL = document.URL;
	var showval = thisURL.split("=")[1];
	var I = null ;
	//进入个人店铺页面显示所有个人商品
	$(document).ready(function() {
		$.ajax("loginSuc",{
			type : "POST",
				dataType : 'text',
					success : function(data) {
						//alert(data);
						var jsonObj = eval("(" + data+ ")");

							$("#table").html("<tr><th>商品序号</th><th>商品名称</th><th>商品图片</th><th>商品种类</th><th>商品单价</th><th>商品库存量</th><th>商品描述</th><th>质量保障</th><th>更改商品</th></tr>")
									$.each(jsonObj,function(i,item) {
										I = item ;
										if (item.commodityId == showval) {
												$("#table").append("<tr><td>"
																	+item.commodityId
																	+ "</td><td>"
																	+ item.commodityName
																	+ "</td><td>"
																	+ "<img src="+item.commodityPic+">"
																	+ "</td><td>"
																	+ item.commodityKinds
																	+ "</td><td>"
																	+ item.commodityPrice
																	+ "</td><td>"
																	+item.commodityNumber
																	+ "</td><td>"
																	+item.commodityDescribe
																	+ "</td><td>"
																	+item.commodityGuaranty
																	+ "</td><td>"
																	+ "<p><a href='modifycommodity.jsp?data="+item.commodityId+"'><input type=button value='修改商品'></a></p><p><button onclick='f()'>删除商品</button></p>"
																	+ "</td></tr>")
																	}
																	//alert(item.sellerId + ","  + item.sellerName);

																});

											}
										});
					});
function f(){
		
		
		
 		$.ajax("deletecommodity",{
 			data : I,
 			type : "POST",
 			success : function(){
 				//alert("ok");
 				alert("删除成功");
 				window.location.href = "deletecommodity.jsp";
 			}
		
 		});
		}
</script>

















<script language="JavaScript" type="text/javascript">
	$(function() {
		var winWidth, winHeight;
		Resize = function() {
			winWidth = $(window).width(), winHeight = $(window).height();
		}
	});
</script>

</html>